#ifndef HDCTREEWIDGET_H
#define HDCTREEWIDGET_H
#include <QtWidgets>
#include "../../../PublicHeard/AVClientSDK/HAVClientUIProtocol.h"

class HDCTreeWidget : public QTreeWidget
{
    Q_OBJECT
public:
    HDCTreeWidget(QWidget *parent = 0);
    ~HDCTreeWidget();
    void                     updateUI(QList<HTTreeItemInfo*>  lstItemInfos);
	void                     appendTreeItem(HTTreeItemInfo* itemInfo);
	HTTreeItemInfo           getTreeItemInfo(QTreeWidgetItem* item);
	QList<QTreeWidgetItem*>  getAllTreeItems();

protected:
    void                     paintEvent(QPaintEvent *event);

private:
	void                     clearTreeWidget();
    void                     initUIStyle();
    void                     createTreeItem(QTreeWidgetItem *parentItem,QList<HTTreeItemInfo*>  lstItemInfos);
	void                     deleteTreeItem(QTreeWidgetItem *parentItem);

private slots:
    void                     sltItemDoubleClicked(QTreeWidgetItem *item,int nColumn);
	void                     sltItemExpanded(QTreeWidgetItem *item);

signals:
    //void                     sigTreeLeafItemDoubleClicked(QVariant varData);
	void                     sigTreeLeafItemDoubleClicked(HTTreeItemInfo *itemInfo);
	void                     sigTreeGroupItemDoubleClicked(HTTreeItemInfo *itemInfo);

private:
	QList<QTreeWidgetItem*>  m_lstLeafItems;
	QList<QTreeWidgetItem*>  m_lstTotalItems;
	QHash<QTreeWidgetItem*,HTTreeItemInfo*> m_hashItemToInfo;
};

#endif
